const { defineConfig } = require('@vue/cli-service')

// console.log('Proxy configuration is being applied...')

module.exports = defineConfig({
  transpileDependencies: true,
  lintOnSave: false,

  devServer: {
    proxy: {
      '/api': {
        // target: "http://139.9.106.208:9060/bang",
        // target: "http://139.9.106.208:9061/bang",
        target: "http://localhost:9061/bang",
        // target: "https://springboot.huangwanyv.top/bang",
        changeOrigin: true,
        pathRewrite: {
          '^/api': ''
        },

      },
      // '/api/img': {
      //   // target: "http://139.9.106.208:9060/bang",
      //   // target: "http://139.9.106.208:9061/bang/img",
      //   target: "http://localhost:9061/bang/img",
      //   changeOrigin: true,
      //   pathRewrite: {
      //     '^/api/img': ''
      //   },
      // }
    }
  }
})



/*nginx配置文件中加“     
    # 代理 API 请求
    location /api {
      proxy_pass http://120.26.67.100:9060/bang;
      proxy_set_header Host $host;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header X-Forwarded-Proto $scheme;
  }
”*/